From 6061d2b5916ec1d39e28ab535c116f1755598ab4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 27 Apr 2009 07:20:23 +0000 Subject: [PATCH] * Small cleanup tweaks --- includes/specials/SpecialRandompage.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php index 31199b2399..3ad29fce5f 100644 --- a/includes/specials/SpecialRandompage.php +++ b/includes/specials/SpecialRandompage.php @@ -36,8 +36,9 @@ class RandomPage extends SpecialPage { public function execute( $par ) { global $wgOut, $wgContLang; - if ($par) + if ($par) { $this->setNamespace( $wgContLang->getNsIndex( $par ) ); + } $title = $this->getRandomTitle(); @@ -78,8 +79,6 @@ class RandomPage extends SpecialPage { private function selectRandomPageFromDB( $randstr ) { global $wgExtraRandompageSQL; - $fname = 'RandomPage::selectRandomPageFromDB'; - $dbr = wfGetDB( DB_SLAVE ); $use_index = $dbr->useIndexClause( 'page_random' ); @@ -98,7 +97,7 @@ class RandomPage extends SpecialPage { ORDER BY page_random"; $sql = $dbr->limitResult( $sql, 1, 0 ); - $res = $dbr->query( $sql, $fname ); + $res = $dbr->query( $sql, __METHOD__ ); return $dbr->fetchObject( $res ); } } -- 2.20.1